﻿@model LeadMaster.ViewModels.ViewModelPerson
@using LeadMaster.Helpers
@using LeadMaster.Properties

@if (!string.IsNullOrEmpty(ViewBag.picName))
{
<div  style="float: right; ">
<img src="../../ClientImages/@(ViewBag.picName)" style="width: @(100 * ViewBag.AspectRatio)px; height: 100px" id="introducerpic"/>    
</div>
}

<header>
<div class="logo" style="vertical-align: middle; text-align: left;">
<img src="~/Images/Dunsmore.png" style="border: none; height: 100px; width: 100px;" alt="Dunsmore Marketing Ltd"/>
<label style="font-family: 'Trebuchet MS'; font-size: 18px;  ">Orac-LYE v1.0 @Model.WelcomeMessage</label>

<nav>
@if (this.User.IsInRole(ApplicationRoles.Legal))
{
<ul>
<li>
    <a href="#" class="menucontents">Lead/Data Types</a>
    <ul>
        <li><a href="@(Url.Action("Index", "FrameworkAgreements"))" class="menucontents">Framework Agreements</a></li>
        <li><a href="@(Url.Action("Index", "TermConditions"))" class="menucontents">Terms & Conditions</a></li>
        <li><a href="@(Url.Action("Index", "Schedules"))" class="menucontents">Order Templates</a></li>
    </ul>
</li>
</ul>
}
            
          
@if (this.User.Identity.Name.Trim().Length > 0)
{
<ul style="float: right;">
    <li>
        <a href="#" class="menucontents">User</a>
        <ul>
            @if (this.User.IsInRole(ApplicationRoles.Outsourcer) ||
                this.User.IsInRole(ApplicationRoles.Installer) ||
                this.User.IsInRole(ApplicationRoles.Introducer) ||
                this.User.IsInRole(ApplicationRoles.Client) ||
                this.User.IsInRole(ApplicationRoles.Engineer) ||
                this.User.IsInRole(ApplicationRoles.Operations) ||
                this.User.IsInRole(ApplicationRoles.DeaGda))
            {
                <li><a href="@(Url.Action("Edit", "CallCentres"))" class="menucontents">Profile</a></li>
            }
            <li style="width: 100px"><a href="@(Url.Action("Logoff", "Account"))" id="loggingout" class="menucontents">Logout</a></li>
            @if (this.User.IsInRole(ApplicationRoles.Administrator))
            {
                <li><a href="@(Url.Action("AddRole", "Account"))" class="menucontents">Add Role</a></li>
                <li><a href="@(Url.Action("AssignUserRole", "Account"))" class="menucontents">Assign User Role</a></li>
                <li><a href="@(Url.Action("Login", "Account"))" class="menucontents">Delete User - not ready</a></li>
                <li><a href="@(Url.Action("Index", "ClientUsers"))" class="menucontents">Assign Client User</a></li>
                <li><a href="@(Url.Action("AssignIntroducer", "Outsourcer"))" class="menucontents">Assign Introducer</a></li>
            }
        </ul>
    </li>
</ul>
}
            
@if (Model.Admin == true && !this.User.IsInRole(ApplicationRoles.DeaGda))
{
<ul style="float: right;">
    <li>
        <a href="#" class="menucontents">Maintenance</a>
        <ul>
            @if (this.User.IsInRole(ApplicationRoles.ClientAdmin))
            {
                <li><a href="@(Url.Action("Create", "CallCentres", new { personType = 'N' }))" class="menucontents">Add Installer</a></li>
                <li><a href="@(Url.Action("Create", "CallCentres", new { personType = 'D' }))" class="menucontents">Add Dea/Gda</a></li>
                <li><a href="@(Url.Action("Create", "CallCentres", new { personType = 'C' }))" class="menucontents">Add User</a></li>
                <li><a href="@(Url.Action("Index", "CallCentres", new { personType = 'N' }))" class="menucontents">Current Installers</a></li>
                <li><a href="@(Url.Action("Index", "CallCentres", new { personType = 'D' }))" class="menucontents">Current GDA/DEA</a></li>
                <li><a href="@(Url.Action("Index", "CallCentres", new { personType = 'C' }))" class="menucontents">Current Users</a></li>
                <li><a href="@(Url.Action("Index", "Regions"))" class="menucontents">Regions</a></li>
                <li><a href="@(Url.Action("AutoAllocate", "CallCentres"))" class="menucontents">Auto Allocate Installers</a></li>
            }
            else if (this.User.IsInRole(ApplicationRoles.Installer))
            {
                <li><a href="@(Url.Action("Create", "CallCentres", new { personType = 'N' }))" class="menucontents">Add User</a></li>                            
                <li><a href="@(Url.Action("Create", "CallCentres", new { personType = 'E' }))" class="menucontents">Add Engineer</a></li>
                <li><a href="@(Url.Action("Index", "CallCentres", new { personType = 'N' }))" class="menucontents">Current Users</a></li>                            
                <li><a href="@(Url.Action("Index", "CallCentres", new { personType = 'E' }))" class="menucontents">Current Engineers</a></li>
            }
            else if (this.User.IsInRole(ApplicationRoles.Operations))
            {
                <li><a href="@(Url.Action("Create", "CallCentres", new { personType = 'I' }))" class="menucontents">Add Introducer</a></li>                            
                <li><a href="@(Url.Action("Index", "CallCentres", new { personType = 'I' }))" class="menucontents">Current Introducers</a></li>
                <li><a href="@(Url.Action("AssignClassification", "CallCentres"))" class="menucontents">Classifications</a></li>   
                <li><a href="@(Url.Action("Index", "FinanceTypes"))" class="menucontents">Finance Types</a></li>   
                <li><a href="@(Url.Action("Index", "FeesCommissions"))" class="menucontents">Fees / Commissions</a></li>                   
                <li><a href="@(Url.Action("Index", "Financial"))" class="menucontents">Accounts</a></li>                                   
            }
        </ul>                                                 
    </li>
</ul>
}


            
@if (this.User.IsInRole(ApplicationRoles.Legal) || this.User.IsInRole(ApplicationRoles.Operations) || this.User.IsInRole(ApplicationRoles.Administrator))
{
    <ul style="float: right; margin-right: 0px;">
        <li>
        <a href="#" class="menucontents">Actions</a>
        <ul>
        @if (this.User.IsInRole(ApplicationRoles.Legal))
        {
        <li style="width: 200px"><a href="@(Url.Action("Index", "ScheduleSections"))" class="menucontents">Legal Sections</a></li>
        <li style="width: 200px"><a href="@(Url.Action("Index", "Sectors"))" class="menucontents">Industries</a></li>
        }
        @if (this.User.IsInRole(ApplicationRoles.Operations))
        {
        <li style="width: 200px"><a href="@(Url.Action("ShowCampaigns", "Outsourcer"))" class="menucontents maintenance">Campaigns</a></li>
        <li style="width: 200px"><a href="@(Url.Action("Index", "LeadBuilder"))" class="menucontents maintenance">LeadBuilder</a></li>
        <li style="width: 200px"><a href="@(Url.Action("Index", "PurchaseOrder"))" class="menucontents maintenance">Purchase Orders</a></li>    
        <li style="width: 200px"><a href="@(Url.Action("IntroducerFees", "CallCentres"))" class="menucontents maintenance">Introducer Fees</a></li>                
        <li style="width: 200px"><a href="@(Url.Action("Index", "Sectors"))" class="menucontents maintenance">Configure Campaigns</a></li>                            
        <li style="width: 200px"><a href="@(Url.Action("UploadLeads", "Leads"))" class="menucontents maintenance">Upload Leads</a></li>                            
        }
        </ul>
        </li>
    </ul>
}

@Html.HiddenFor(m => Model.Person.Category)
@Html.HiddenFor(m => Model.Person.ConfirmedTC)            

@if (Model.Person.Category == "I" && Model.Person.ConfirmedTC == true)
{
    <ul style="float: right;">
        <li>
        <a href="#" class="menucontents">Leads</a>
        <ul>
            <li><a href="@(Url.Action("EnterLeads", "Outsourcer"))" class="menucontents">Enter Leads</a></li>
            <li><a href="@(Url.Action("Index", "Outsourcer", new { isReleaseOnly = true }))" class="menucontents">Release To Client</a></li>
            <li><a href="@(Url.Action("Index", "Outsourcer"))" class="menucontents">View Leads</a></li>
        </ul>
        </li>
    </ul>
    <ul style="float: right;">
        <li>
        <a href="#" class="menucontents">Reports</a>
        <ul>
            <li><a href="@(Url.Action("ByStatus", "Outsourcer"))" target=_blank class="menucontents">By Status</a></li>                                                        
        </ul>
        </li>
    </ul>    
}



      
@if ("NDEO".IndexOf(Model.PersonType) != -1 && Model.Person.ConfirmedTC == true)
{
    <ul style="float: right;">
        <li>
        <a href="#" class="menucontents">Leads</a>
        <ul>
            <li style="width: 200px"><a href="@(Url.Action("ViewLeads", "Client"))" class="menucontents">View Leads</a></li>
        </ul>
        </li>
    </ul>
}

@if (Model.PersonType == "C")
{
    <ul style="float: right;">
        <li>
        <a href="#" class="menucontents">Leads</a>
        <ul>
            <li style="width: 200px"><a href="@(Url.Action("ViewLeads", "Client"))" class="menucontents">View Leads</a></li>
        </ul>
        </li>
    </ul>
}

@if (this.User.IsInRole(ApplicationRoles.Operations))
{
    <ul style="float: right;">
        <li>
        <a href="#" class="menucontents">Reports</a>
        <ul>
            <li><a href="http://webellas.arvixevps.com/ReportServer_SQLEXPRESS/Pages/ReportViewer.aspx?%2forac%2flye%2fSummary&rs:Command=Render" class="menucontents" target="_blank">Summary</a></li>
            <li><a href="http://webellas.arvixevps.com/ReportServer_SQLEXPRESS/Pages/ReportViewer.aspx?%2forac%2flye%2fEarnt&rs:Command=Render" class="menucontents" target="_blank">Earnt</a></li>
            <li><a href="http://webellas.arvixevps.com/ReportServer_SQLEXPRESS/Pages/ReportViewer.aspx?%2forac%2flye%2fByStatus&rs:Command=Render" class="menucontents" target="_blank">By Status</a></li>
            <li><a href="http://webellas.arvixevps.com/ReportServer_SQLEXPRESS/Pages/ReportViewer.aspx?%2forac%2flye%2fByFinancialAction&rs:Command=Render" class="menucontents" target="_blank">By Financial Action</a></li>
        </ul>
        </li>
    </ul>
}

@if (this.User.IsInRole(ApplicationRoles.ClientAdmin))
{
   <ul style="float: right;">
        <li>
        <a href="#" class="menucontents">Reports</a>
        <ul>
            <li><a href="http://webellas.arvixevps.com/ReportServer_SQLEXPRESS/Pages/ReportViewer.aspx?%2forac%2flye%2fByStatus&rs:Command=Render" class="menucontents" target="_blank">By Status</a></li>
            <li><a href="http://webellas.arvixevps.com/ReportServer_SQLEXPRESS/Pages/ReportViewer.aspx?%2forac%2flye%2fInstallerStats&rs:Command=Render" class="menucontents" target="_blank">Installer Stats</a></li>
        </ul>
        </li>
    </ul>
}
    
<div style="clear: both;">
</div>
</nav>
</div>
</header>
